<!DOCTYPE html>
<html>
<head>
    <title>Basic usage</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" >

    <link href="../../content/shared/styles/examples-offline.css" rel="stylesheet">
    <link href="../../../styles/kendo.dataviz.min.css" rel="stylesheet">

    <script src="../../../js/jquery.min.js"></script>
    <script src="../../../js/kendo.dataviz.min.js"></script>
    <script src="../../content/shared/js/console.js"></script>
</head>
<body>
    <a class="offline-button" href="../index.html">Back</a>
    <div id="example" class="k-content">
    <div class="chart-wrapper">
        <table class="history">
            <tr>
                <td class="item">mmHg</td>
                <td class="chart"><div id="chart-mmHg"></div></td>
            </tr>
            <tr>
                <td class="item">hPa</td>
                <td class="chart"><div id="chart-hPa"></div></td>
            </tr>
            <tr>
                <td class="item">hum</td>
                <td class="chart"><div id="chart-hum"></div></td>
            </tr>
            <tr>
                <td class="item">temp</td>
                <td class="chart"><div id="chart-temp"></div></td>
            </tr>
        </table>
    </div>
    <script>
        function createChart() {
            $("#chart-mmHg").kendoChart({
                legend: {
                    visible: false
                },
                series: [{
                    type: "bullet",
                    data: [[750, 762.5]]
                }],
                chartArea: {
                    margin: {
                        left: 0
                    }
                },
                categoryAxis: {
                    majorGridLines: {
                        visible: false
                    },
                    majorTicks: {
                        visible: false
                    }
                },
                valueAxis: [{
                    plotBands: [{
                        from: 715, to: 752, color: "#ccc", opacity: .6
                    }, {
                        from: 752, to: 772, color: "#ccc", opacity: .3
                    }],
                    majorGridLines: {
                        visible: false
                    },
                    min: 715,
                    max: 795,
                    minorTicks: {
                        visible: true
                    }                    
                }],
                tooltip: {
                    visible: true,
                    shared: true,
                    template: "Maximum: #= value.target # <br /> Average: #= value.current #"
                }
            });

            $("#chart-hPa").kendoChart({
                legend: {
                    visible: false
                },
                series: [{
                    type: "bullet",
                    data: [[1001, 1017]]
                }],
                chartArea: {
                    margin: {
                        left: 0
                    }
                },
                categoryAxis: {
                    majorGridLines: {
                        visible: false
                    },
                    majorTicks: {
                        visible: false
                    }
                },
                valueAxis: [{
                    plotBands: [{
                        from: 955, to: 1002, color: "#ccc", opacity: .6
                    }, {
                        from: 1002, to: 1027, color: "#ccc", opacity: .3
                    }],
                    majorGridLines: {
                        visible: false
                    },
                    min: 955,
                    max: 1055,
                    minorTicks: {
                        visible: true
                    }
                }],
                tooltip: {
                    visible: true,
                    shared: true,
                    template: "Maximum: #= value.target # <br /> Average: #= value.current #"
                }
            });

            $("#chart-hum").kendoChart({
                legend: {
                    visible: false
                },
                series: [{
                    type: "bullet",
                    data: [[45, 60]]
                }],
                categoryAxis: {
                    majorGridLines: {
                        visible: false
                    },
                    majorTicks: {
                        visible: false
                    }
                },
                valueAxis: [{
                    plotBands: [{
                        from: 0, to: 33, color: "#ccc", opacity: .6
                    }, {
                        from: 33, to: 66, color: "#ccc", opacity: .3
                    }],
                    majorGridLines: {
                        visible: false
                    },
                    min: 0,
                    max: 100,
                    minorTicks: {
                        visible: true
                    }
                }],
                tooltip: {
                    visible: true,
                    shared: true,
                    template: "Maximum: #= value.target # <br /> Average: #= value.current #"
                }
            });
            
            $("#chart-temp").kendoChart({
                legend: {
                    visible: false
                },
                series: [{
                    type: "bullet",
                    data: [[25, 22]]
                }],
                categoryAxis: {
                    majorGridLines: {
                        visible: false
                    },
                    majorTicks: {
                        visible: false
                    }
                },
                valueAxis: [{
                    plotBands: [{
                        from: 0, to: 10, color: "yellow", opacity: .3
                    }, {
                        from: 10, to: 20, color: "orange", opacity: .3
                    }, {
                        from: 20, to: 30, color: "red", opacity: .3
                    }],
                    majorGridLines: {
                        visible: false
                    },
                    min: 0,
                    max: 30,
                    minorTicks: {
                        visible: true
                    }
                }],
                tooltip: {
                    visible: true,
                    shared: true,
                    template: "Maximum: #= value.target # <br /> Average: #= value.current #"
                }
            });
        }

        $(document).ready(function() {
            setTimeout(function() {
                // Initialize the chart with a delay to make sure
                // the initial animation is visible
                createChart();

                $("#example").bind("kendo:skinChange", function(e) {
                    createChart();
                });
            }, 400);
        });
    </script>
    <style scoped>
        .history {
            border-collapse: collapse;
            width: 100%;
        }
        .history td.chart {
            width: 430px;
        }
        .history .k-chart {
            height: 65px;
            width: 400px;
        }
        .history td.item {
            line-height: 65px;
            width: 20px;
            text-align: right;
            padding-bottom: 22px;
        }
        
        .chart-wrapper  {
            width: 450px;
            height: 350px;    
        }
    </style>
</div>

</body>
</html>
